﻿namespace MUD.Lib.Utils
{
    public struct Bound
    {
        public int Min;
        public int Max;
        public int Current;

        public Bound(int min, int max, int initial)
        {
            Min = min;
            Max = max;
            Current = initial;
        }

        public void Change(int amt)
        {
            if (Current + amt > Max)
            {
                Current = Max;
            }
            else if (Current + amt < Min)
            {
                Current = Min;
            }
            else
            {
                Current = Current + amt;
            }
        }
    }
}